package com.woniuxy.dao.impl;

import com.woniuxy.dao.StuDao;
import com.woniuxy.entity.Stu;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.SQLException;

/**
 * @author 作者
 * @create 2025-09-24 17:16
 */
public class StudentDaoImpl implements StuDao {
    QueryRunner qr = new QueryRunner();

    @Override
    public void insert(Stu stu) throws SQLException, ClassNotFoundException {
        String sql="insert into stu values(?,?,?,?)";
        qr.update(JdbcUtil.getConnection(), sql,stu.getSid(),
                stu.getSname(),stu.getPassword(),stu.getAge());
    }
}
